package com.esoon.service.impl;

import com.esoon.dao.CosDeptDao;
import com.esoon.service.CosDeptService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName CosDeptServiceImpl
 * @Description TODO 根据客户主叫号码查询DT_CODE 查询失败返回查询失败
 * @Author 2020/10/15 18:41
 * @Version 1.0
 **/
@Service
public class CosDeptServiceImpl implements CosDeptService {

    private static final Logger logger;

    static {
        logger = LoggerFactory.getLogger(CosDeptServiceImpl.class);
    }

    @Resource
    private CosDeptDao cosDeptDao;
    @Override
    public String selectDtCodeByAni(String ani) {
        try{
            String dt_code = cosDeptDao.selectDtCodeByAni(ani);
            if (dt_code == null || dt_code.length() <=0){
                return "查询为空";
            }else {
                return dt_code;
            }
        }catch (Exception e){
            logger.error(e.toString());
            return "查询报错";
        }
    }
}
